package cate.game.res.lottery;

import cate.common.table.d.GDTreasureTurntable;
import cate.game.activity.lottery.data.LotteryLogDetail;
import cate.game.db.facade.KvLoader;
import cate.game.db.mongo.kv.KvMongo;
import cate.game.framework.ModuleMan;

public class LotteryManager extends ModuleMan {
    public LotterySPO data;
    @Override
    public void initDependent() throws Exception {
        data = new KvLoader<>(game, LotterySPO.class, KvMongo.KEY_LOTTERY).getBySrvId();
        data.initialize();
    }

    public void addLog(LotteryLogDetail log) {
        data.addLog(log, GDTreasureTurntable.LOG_SIZE);
    }

    @Override
    public void shutdown(){
        game.db.kv.save(data);
    }

}
